import { useState } from 'react'

export default () => {
  const [loading, setLoading] = useState(false)
  const [loadingTitle, setLoadingTitle] = useState('Loading...')
  const [loadingStyle, setLoadingStyle] = useState<React.CSSProperties>({
    backgroundColor: 'rgba(0,0,0,0.75)', //修改Spin原来的背景颜色
    minHeight: '100vh', //使其为整个页面高度
    position: 'fixed',
    zIndex: '9999',
  })
  const handleLoading = (flag: boolean) => {
    setLoading(flag)
  }

  return { loading, setLoading, loadingTitle, loadingStyle, handleLoading }
}
